home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 3.3 KB | 140 lines | [TEXT/CWIE] |
- // Window.h
-
- #ifndef Window_h
- #define Window_h
-
- #ifndef AbstractWindow_h
- #include "AbstractWindow.h"
- #endif
- #ifndef WindowController_h
- #include "WindowController.h"
- #endif
- #ifndef WindowDefaults_h
- #include "WindowDefaults.h"
- #endif
- #ifndef WindowObject_h
- #include "WindowObject.h"
- #endif
- #ifndef RootPane_h
- #include "RootPane.h"
- #endif
- #ifndef SimpleProxy_h
- #include "SimpleProxy.h"
- #endif
- #ifndef WindowLocator_h
- #include "WindowLocator.h"
- #endif
- #ifndef WindowFocus_h
- #include "WindowFocus.h"
- #endif
- #ifndef GrafPortContext_h
- #include "GrafPortContext.h"
- #endif
- #ifndef ContextFree_h
- #include "ContextFree.h"
- #endif
- #ifndef Closing_h
- #include "Closing.h"
- #endif
- #ifndef Receiver_h
- #include "Receiver.h"
- #endif
- #ifndef PreparingToQuit_h
- #include "PreparingToQuit.h"
- #endif
- #ifndef PreparingToClose_h
- #include "PreparingToClose.h"
- #endif
- #ifndef CommandLink_h
- #include "CommandLink.h"
- #endif
-
- class WindowInitializer;
- class WindowDefinition;
-
- class Window: public ContextFree,
- public WindowController,
- public WindowDefaults,
- public Receiver<PreparingToQuit>,
- public Closing,
- public Broadcaster<PreparingToClose>,
- private AbstractWindow
- {
- private:
- const WindowDefinition& definition;
- WindowObject window;
- WindowFocus focus;
- RootPane pane;
- String255 nameString;
- GrafPortContext context;
- WindowLocator::Registration registration;
- CommandLink<Closing> closingLink;
-
- SimpleProxy<Window,bool> visibility;
- SimpleProxy<Window,bool> zoomed;
- SimpleProxy<Window,Rectangle> bounds;
- SimpleProxy<Window,ConstPString> name;
- SimpleProxy<Window,uint32> index;
-
- protected:
- virtual void Update();
-
- virtual void Activate();
- virtual void Deactivate();
-
- virtual void ClickContent( const MouseDownEvent& );
- virtual void ClickDrag( const MouseDownEvent& );
- virtual void ClickClose( const MouseDownEvent& );
- virtual void ClickZoomIn( const MouseDownEvent& );
- virtual void ClickZoomOut( const MouseDownEvent& );
- virtual void ClickGrow( const MouseDownEvent& );
-
- bool GetVisibility() const;
- virtual void SetVisibility( bool );
-
- bool GetZoomed() const;
- virtual void SetZoomed( bool );
-
- Rectangle GetBounds() const;
- virtual void SetBounds( Rectangle );
-
- ConstPString GetName() const;
- virtual void SetName( ConstPString );
-
- uint32 GetIndex() const;
- virtual void SetIndex( uint32 );
-
- public:
- Window( const WindowDefinition& );
- virtual ~Window();
-
- void Initialize( const WindowInitializer& );
-
- WindowFocus& Focus() { return focus; }
- const WindowFocus& Focus() const { return focus; }
-
- GrafPortContext& Context() { return context; }
- const GrafPortContext& Context() const { return context; }
-
- virtual GDHandle DefaultScreen() const;
- virtual Rectangle DefaultPosition( GDHandle screen ) const;
-
- Pane& RootPane() { return pane; }
- const Pane& RootPane() const { return pane; }
-
- virtual bool CanClose() const;
- virtual void Close( SavingOption save = SavingOption::ask );
- virtual void PrepareToQuit( SavingOption );
-
- virtual GDHandle BestScreen() const;
- virtual Rectangle BestBounds() const;
- virtual Rectangle BestBounds( GDHandle screen ) const;
- virtual Rectangle BestBounds( Rectangle available ) const;
-
- virtual Rectangle AvailableArea( GDHandle ) const;
-
- void SetContext() { context.BeCurrent(); }
- };
-
- #endif
-